import service.back;

import java.util.Scanner;

/*
* 操作系统首页
* */
public class main {
    public static void main(String[] args) {
        back back=new back();
        Scanner input=new Scanner(System.in);
        boolean j=true;
        while(j){
            System.out.println("请输入您的账号");
            String a=input.next();
            System.out.println("请输入您的密码");
            String b=input.next();
            String login = back.login(a,b);
            if(login!=null){
                back.hello();
                int i= input.nextInt();
                if(i==0){//退出
                    System.out.println("业务结束,欢迎下次光临");
                    j=false;
                }
                if(i==1){//存款
                    System.out.println("欢迎来到存款界面");
                    System.out.println("请输入您要存入的余额");
                    double b1=input.nextDouble();
                    String save = back.save(login, b1);
                    System.out.println(save);
                    System.out.println("您还需要继续办理业务吗？");
                    back.hello1();
                    int i1= input.nextInt();
                    i = back.res(i1);
                }
                if(i==2){//取款
                    System.out.println("欢迎来到取款界面");
                    System.out.println("请输入您要取出的余额");
                    double b1=input.nextDouble();
                    String take = back.take(login, b1);
                    System.out.println(take);
                    System.out.println("您还需要继续办理业务吗？");
                    back.hello1();
                    int i1= input.nextInt();
                    i=back.res(i1);

                }
                if(i==3){//余额
                    String balance = back.balance(login);
                    System.out.println(balance);
                    System.out.println("您还需要继续办理业务吗？");
                    back.hello1();
                    int i1= input.nextInt();
                    i=back.res(i1);

                }

            }
        }
    }
}
